import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

// Naive UI 配置
import {
  NConfigProvider,
  NButton,
  NLayout,
  NLayoutHeader,
  NLayoutContent,
  NLayoutFooter,
  NMenu,
  NSpace
} from 'naive-ui'
import 'vfonts/Lato.css'
import 'vfonts/FiraCode.css'

const naiveComponents = {
  NConfigProvider,
  NButton,
  NLayout,
  NLayoutHeader,
  NLayoutContent,
  NLayoutFooter,
  NMenu,
  NSpace
}

const app = createApp(App)

// 注册 Naive UI 组件
Object.keys(naiveComponents).forEach(key => {
  app.component(key, naiveComponents[key])
})

app.use(router)
app.mount('#app')